import { createRouter, createWebHistory } from 'vue-router'
import Login from '@/views/Login.vue'
import AdminLogin from '@/views/AdminLogin.vue'
import AdminReg from '@/views/AdminReg.vue'
import Test from '@/views/Test.vue'
import Reg from '@/views/Reg.vue'
import AddWeibo from '@/views/AddWeibo.vue'
import Detail2 from '@/views/Detail2.vue'
import Attention from '@/views/Attention.vue'
import List from '@/views/List.vue'
import MyComment from '@/views/MyComment.vue'
import He from '@/views/He.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'login',
      component: Login
    },
    {
      path: '/reg',
      name: 'reg',
      component: Reg
    },
    {
      path: '/detail2',
      name: 'detail2',
      component: Detail2
    },
    {
      path: '/list',
      name: 'list',
      component: List
    },
    {
      path: '/addweibo',
      name: 'addweibo',
      component: AddWeibo
    },
    {
      path: '/adminlogin',
      name: 'adminlogin',
      component: AdminLogin
    },
    {
      path: '/adminreg',
      name: 'adminreg',
      component: AdminReg
    },
    {
      path: '/he',
      name: 'he',
      component: He
    },
    {
      path: '/attention',
      name: 'attention',
      component: Attention
    },
    {
      path: '/test',
      name: 'test',
      component: Test
    },
    {
      path:'/admireHome',
      name: 'admireHome',
      component:()=>import('../views/admireHome.vue'),
      children:[
        {
          path:'/addAdmin',
          name:'addAdmin',
          component:()=>import('../components/admin/addAdmin.vue')
        },
        {
          path:'/banUser',
          name:'banUser',
          component:()=>import('../components/admin/banUser.vue')
        },
        {
          path:'/reviewComments',
          name:'reviewComments',
          component:()=>import('../components/admin/reviewComments.vue')
        },
        {
          path:'/reviewWeibo',
          name:'reviewWeibo',
          component:()=>import('../components/admin/reviewWeibo.vue')
        }
      ]
    },
    {
      path: '/mycomment',
      name: 'mycomment',
      component: MyComment
    },
  ]
})

export default router
